package com.hxzy.dao;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import com.hxzy.dao.BaseDao.Params;

public interface BaseDao<T extends Serializable> {
    T create(T t);// add

    int delete(T t);

    int update(T t);

    List<T> read(String hql, Params... params);

    List<T> read(String hql, Map<String, Object> params);

    T read(Class<T> t, long id);

    public static final class Params implements Serializable {
        private static final long serialVersionUID = -4057126517375892852L;
        public final String key;
        public final Object value;

        public Params(String key, Object value) {
            this.key = key;
            this.value = value;
        }
    }

}
